package com.daka.controller;

import com.daka.entity.UserTest;
import com.daka.enumerate.StatusCode;
import com.daka.service.GroupService;
import com.daka.service.GroupVolunteerService;
import com.daka.service.MemberOrgService;
import com.daka.service.OrganizationService;
import com.daka.vo.response.DataResponseVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by yangx
 * CreateTime: 2016/11/24 14:02
 */
@Controller
@RequestMapping("/group")
@Slf4j
public class GroupController {

    @Autowired
    private GroupService groupService;
    @Autowired
    private GroupVolunteerService groupVolunteerService;
    @Autowired
    private OrganizationService organizationService;
    @Autowired
    private MemberOrgService memberOrgService;


    @RequestMapping(value = "/test", method = RequestMethod.POST)
    @ResponseBody
    public DataResponseVo test(String aaa, String bbb) {
        log.info("【【【【【【【" + aaa + bbb + "】】】】】】】");
        return new DataResponseVo(StatusCode.OK.getCode(), StatusCode.OK.getMessage(), "this is a test!");
    }

    @RequestMapping(value = "/groupOrg", method = RequestMethod.POST)
    @ResponseBody
    public DataResponseVo groupOrg() {
        log.info("【【【【【【【group-organization】】】】】】】");
        int a = groupService.groupOrg(0, 0);
        return new DataResponseVo(StatusCode.OK.getCode(), StatusCode.OK.getMessage());
    }

    @RequestMapping(value = "/groupVolunteer", method = RequestMethod.POST)
    @ResponseBody
    public DataResponseVo groupVolunteer() {
        int a = groupVolunteerService.groupVolunteer(0, 0);
        return new DataResponseVo(StatusCode.OK.getCode(), StatusCode.OK.getMessage());
    }



}





